import { createRouter, createWebHistory } from 'vue-router'
import Layout from '../Layout/index.vue'

import UserHome from '../views/Home/index.vue'
import SearchResult from '../views/Search/index.vue'
import Login from '../views/Login/Login.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'layout',
      component: Layout,
      children: [
        {
          path: "",
          name: 'userhome',
          component: UserHome
        }, {
          path: "searchresult",
          name: "search",
          component: SearchResult
        }
      ]
    },
    {
      path: '/login',
      name: 'login',
      component: Login
    }
  ]
})

export default router
